<template>
  <div>
    22222222
    <!-- 获取路由路径的参数 -->
    <p>{{this.$route.params}}</p>
    <p>{{$route.params}}</p>
    <p>{{'$route.params.msg:'+$route.params.msg}}</p>

    <p>通过属性传递过来的参数</p>
    <p>id: {{id}}</p>
    <p>msg: {{msg}}</p>
    <p>foo: {{foo}}</p>
  </div>
</template>

<script>
export default {
  props: ["id", "msg", "foo"],
  created() {
    console.log(this.$route);

    //查询参数
    console.log(this.$route.query.foo);
  }
};
</script>

<style lang="scss" scoped>
</style>